{% extends "base.html" %}
{% block title %}<title>编辑项目概况-消防系统计算平台</title>{% endblock %}
{% block extrastyle %}
    {% load static %}
    <style type="text/css">
        .col-lg-3 {
            text-align: right;
        }
    </style>
{% endblock %}
{% block header %}
    {% include "header.html" %}
    <!--{% include "select_module.html" %}-->
{% endblock %}

{% block content %}
    <div class="content">
        <form action="{% url 'introduction_edit' p.id %}" method="post">
            <input type="hidden" name="pk" value="{% if p.id %}{{ p.id }}{% endif %}">
            {% csrf_token %}
            <div class="row">
                <div class="col-lg-12">
                    <div class="form-group">
                        <div class="col-lg-3"><label>项目名称<span style="color:red">*</span>：</label></div>
                        <div class="col-lg-8">
                            <input type="text" class="form-control" id="project_name" name="project_name"
                                   value="{{ p.project_name }}" placeholder="请输入项目名称"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="form-group">
                        <div class="col-lg-3"><label>项目编号<span style="color:red">*</span>：</label></div>
                        <div class="col-lg-8">
                            <input type="text" class="form-control" id="project_num" name="project_num"
                                   value="{{ p.project_num }}" placeholder="请输入项目编号"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="form-group">
                        <div class="col-lg-3"><label>项目概况<span style="color:red">*</span>：</label></div>
                        <div class="col-lg-8">
                        <textarea type="text" class="form-control" id="project_text" name="project_text" rows="5"
                                  placeholder="请输入项目概况">{{ p.project_text }}</textarea>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="form-group">
                        <div class="col-lg-3"><label>设计人<span style="color:red">*</span>：</label></div>
                        <div class="col-lg-8">
                            <input type="text" class="form-control" id="designer" name="designer" value="{{ p.designer }}"
                                   placeholder="请输入项目设计人"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="form-group">
                        <div class="col-lg-3"><label>校对人<span style="color:red">*</span>：</label></div>
                        <div class="col-lg-8">
                            <input type="text" class="form-control" id="proofreader" name="proofreader"
                                   value="{{ p.proofreader }}" placeholder="请输入项目校对人"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="form-group">
                        <div class="col-lg-3"><label>专业负责人<span style="color:red">*</span>：</label></div>
                        <div class="col-lg-8">
                            <input type="text" class="form-control" id="chief" name="chief" value="{{ p.chief }}"
                                   placeholder="请输入专业负责人"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="form-group">
                        <div class="col-lg-3"><label>审批人<span style="color:red">*</span>：</label></div>
                        <div class="col-lg-8">
                            <input type="text" class="form-control" id="approver" name="approver" value="{{ p.approver }}"
                                   placeholder="请输入审批人"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="form-group">
                        <div class="col-lg-3"><label>版本号<span style="color:red">*</span>：</label></div>
                        <div class="col-lg-8">
                            <input type="text" class="form-control" id="version" name="version" value="{{ p.version }}"
                                   placeholder="请输入版本号"/>
                        </div>
                    </div>
                </div>
            </div>
            <h3>选择项目模块：</h3><label style="color:red">（如果减少模块会导致对应表的数据被删除）</label>
            <div class="row" style="margin-bottom:10px">
                <div class="col-lg-4">
                    <div class="input-group">
			 <span class="input-group-addon">
				 <input type="checkbox" name="{{ module_list.0.module_en_name }}"
                        id="{{ module_list.0.module_en_name }}" {% if module_list.0.select %}
                               checked="checked" {% endif %} >
			 </span>
                        <input type="text" class="form-control" disabled value="{{ module_list.0.module_name }}">
                    </div>
                </div>
                <div class="col-lg-3">
                    <div class="input-group">
				 <span class="input-group-addon">
					 <input type="checkbox" name="{{ module_list.1.module_en_name }}"
                            id="{{ module_list.1.module_en_name }}" {% if module_list.1.select %}
                            checked="checked" {% endif %} >
				 </span>
                        <input type="text" class="form-control" disabled value="{{ module_list.1.module_name }}">
                    </div>
                </div>

                <div class="col-lg-5">
                    <div class="input-group">
				<span class="input-group-addon">
					<input type="checkbox" name="{{ module_list.2.module_en_name }}"
                           id="{{ module_list.2.module_en_name }}" {% if module_list.2.select %}
                            checked="checked" {% endif %}>
				</span>
                        <input type="text" class="form-control" disabled value="{{ module_list.2.module_name }}">

                        <span class="input-group-addon">
					<input type="checkbox" name="hydrant" id="hydrant" {% if module_list.2.have %}
                           checked="checked" {% endif %}>
				</span>
                        <input type="text" class="form-control" disabled value="有无室外消火栓供水泵">
                    </div>
                </div>
            </div>

                <div class="row" style="margin-bottom:10px">
                    <div class="col-lg-4">
                        <div class="input-group">
					<span class="input-group-addon">
						<input type="checkbox" name="{{ module_list.3.module_en_name }}"
                               id="{{ module_list.3.module_en_name }}" {% if module_list.3.select %}
                               checked="checked" {% endif %} >
					</span>
                            <input type="text" class="form-control" disabled value="{{ module_list.3.module_name }}">
                        </div>
                    </div>
                    <div class="col-lg-4">
                        <div class="input-group">
					<span class="input-group-addon">
						<input type="checkbox" name="{{ module_list.4.module_en_name }}"
                               id="{{ module_list.4.module_en_name }}" {% if module_list.4.select %}
                               checked="checked" {% endif %} >
					</span>
                            <input type="text" class="form-control" disabled value="{{ module_list.4.module_name }}">
                        </div>
                    </div>
                    <div class="col-lg-4">
                        <div class="input-group">
					<span class="input-group-addon">
						<input type="checkbox" name="{{ module_list.5.module_en_name }}"
                               id="{{ module_list.5.module_en_name }}" {% if module_list.5.select %}
                               checked="checked" {% endif %} >
					</span>
                            <input type="text" class="form-control" disabled value="{{ module_list.5.module_name }}">
                        </div>
                    </div>
                </div>
                <div class="row" style="margin-bottom:10px">
                    <div class="col-lg-4">
                        <div class="input-group">
					<span class="input-group-addon">
						<input type="checkbox" name="{{ module_list.6.module_en_name }}"
                               id="{{ module_list.6.module_en_name }}"  {% if module_list.6.select %}
                               checked="checked" {% endif %} >
					</span>
                            <input type="text" class="form-control" disabled value="{{ module_list.6.module_name }}">
                        </div>
                    </div>
                    <div class="col-lg-4">
                        <div class="input-group">
					<span class="input-group-addon">
						<input type="checkbox" name="{{ module_list.7.module_en_name }}"
                               id="{{ module_list.7.module_en_name }}" {% if module_list.7.select %}
                               checked="checked" {% endif %} >
					</span>
                            <input type="text" class="form-control" disabled value="{{ module_list.7.module_name }}">
                        </div>
                    </div>
                    <div class="col-lg-4">
                        <div class="input-group">
					<span class="input-group-addon">
						<input type="checkbox" name="{{ module_list.8.module_en_name }}"
                               id="{{ module_list.8.module_en_name }}" {% if module_list.8.select %}
                               checked="checked" {% endif %} >
					</span>
                            <input type="text" class="form-control" disabled value="{{ module_list.8.module_name }}">
                        </div>
                    </div>
                </div>
                <div class="row" style="margin-bottom:10px">
                    <div class="col-lg-4">
                        <div class="input-group">
					<span class="input-group-addon">
						<input type="checkbox" name="{{ module_list.9.module_en_name }}"
                               id="{{ module_list.9.module_en_name }}"{% if module_list.9.select %}
                               checked="checked" {% endif %} >
					</span>
                            <input type="text" class="form-control" disabled value="{{ module_list.9.module_name }}">
                        </div>
                    </div>
                </div>
                <input type="submit" class="btn-primary" value="保存">
                <a id="cancel"  href="{% url 'introduction' p.id%}"><button class="btn-primary">取消</button></a>
        </form>
    </div>
{% endblock %}

{% block extrajs %}
{{ block.super }}
    <script>
    $.globalMessenger().post({
        message: "{{ data }}",
        hideAfter: 6,
        type: "{{ type }}",
    });
        window.onbeforeunload = function(event) {
            event.returnValue = "有数据未保存";
        };
    </script>

{% endblock %}